package com;

import com.anno.ParamValidate;
import com.entity.TestUser;

import java.lang.reflect.Field;

/**
 * @author :Administrator
 * @description: TODO edit class Description
 * @create date: 2022/3/11 10:19
 */
public class AnnotationTest {
    public static void main(String[] args) {
        Field[] declaredFields = TestUser.class.getDeclaredFields();
        for (Field declaredField : declaredFields) {
            ParamValidate[] tableId = declaredField.getDeclaredAnnotationsByType(ParamValidate.class);
            System.out.printf("结果 : %s \n",tableId[0].value()[0]);
            for (int i = 0; i < tableId.length; i++) {
                System.out.printf("结果 : %s \n",tableId[i].value()[0]);
            }
            /*for (TableId anno : tableId) {
                System.out.printf("结果 : %s ，%s \n",anno.type() ,anno.value());
            }*/

        }
    }
}
